using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

namespace GPUParticles
{
[CustomEditor(typeof(ParticlesManager)), CanEditMultipleObjects]
public class GPUParticleEmitterEditor : Editor
{
    private static GPUParticleEmitterEditor instance;

    private List<Module> modules;
    

    public static GPUParticleEmitterEditor GetInstance()
    {
        return instance;
    }

    private void OnEnable()
    {
        instance = this;

        

        modules = new List<Module>
        {
            new ColorModule(serializedObject, targets),
            new SizeModule(serializedObject, targets),
            new InheritinfoModule(serializedObject),
            new LifetimeModule(serializedObject),
            new EmissionModule(serializedObject),
            new AssetsModule(serializedObject),
            new EffectModules(serializedObject)
        };
    }

    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        

        GUI.color = Color.white;

        foreach (Module cur in modules)
        {
            cur.Draw();
        }

        serializedObject.ApplyModifiedProperties();
    }
}
}
